package com.yan.movie.controller;

import com.yan.movie.dao.Dao;

import java.util.Scanner;

/**
 * @author taoge
 * @Date 2024/8/1 16:38
 * @Description
 */
public class ControllerIogIn {
    public static final Scanner INPUT = new Scanner(System.in);
    public static final Dao DAO = new Dao();
    public static final ControllerIndex index = new ControllerIndex();
    public static void main(String[] args) {
        while (true) {
            System.out.println("请输入账号:");
            String zhangHao = INPUT.next();
            System.out.println("请输入密码");
            int i = INPUT.nextInt();
            boolean flag = false;
            if(zhangHao.equals(DAO.ZHANG_HAO)){
                if(i == DAO.PASSWORD){
                    System.out.println("登录成功");
                    flag = true;
                }
            }
            if(flag){
               index.Index();
            }else{
                System.out.println("账号密码错误");
            }
        }
    }
}
